<?php

/*  Wikka CLI Config File

    This file hides a lot of the initialization mess from the main script
    file in here.  More attention will be given to cleaning it up later.
*/

error_reporting (E_ALL ^ E_NOTICE);

// If you need to use this installation with a configuration file outside the
// installation directory uncomment the following line and adapt it to reflect
// the (filesystem) path to where your configuration file is located.
// This would make it possible to store the configuration file outside of the
// webroot, or to share one configuration file between several Wikka Wiki
// installations.
// This replaces the use of the environment variable WAKKA_CONFIG for security
// reasons. [SEC]
#if (!defined('WAKKA_CONFIG')) define('WAKKA_CONFIG','path/to/your/wikka.config.php');

/**
 * Defines the current Wikka version. Do not change the version number or you will have problems upgrading.
 */
if (!defined('WAKKA_VERSION')) define('WAKKA_VERSION', '1.3.2');

/**#@+
 * Internationalization constant.
 */
define('ERROR_WRONG_PHP_VERSION', 'Wikka requires PHP %s or higher!');	// %s - version number
define('MINIMUM_PHP_VERSION', '4.1');
if ( ! defined('ERROR_WAKKA_LIBRARY_MISSING') )
    define('ERROR_WAKKA_LIBRARY_MISSING','The necessary file "libs/Wakka.class.php" could not be found. To run Wikka, please make sure the file exists and is placed in the right directory!');
if ( ! defined('ERROR_MYSQL_SUPPORT_MISSING') )
    define('ERROR_MYSQL_SUPPORT_MISSING', 'PHP can\'t find MySQL support but Wikka requires MySQL. Please check the output of <tt>phpinfo()</tt> in a php document for MySQL support: it needs to be compiled into PHP, the module itself needs to be present in the expected location, <strong>and</strong> php.ini needs to have it enabled.<br />Also note that you cannot have <tt>mysqli</tt> and <tt>mysql</tt> support both enabled at the same time.<br />Please double-check all of these things, restart your webserver after any fixes, and then try again!');
if ( ! defined('ERROR_SETUP_FILE_MISSING') )
    define('ERROR_SETUP_FILE_MISSING', 'A file of the installer/ upgrader was not found. Please install Wikka again!');
if (!defined('ERROR_SETUP_HEADER_MISSING')) define('ERROR_SETUP_HEADER_MISSING', 'The file "setup/header.php" was not found. Please install Wikka again!');
if (!defined('ERROR_SETUP_FOOTER_MISSING')) define('ERROR_SETUP_FOOTER_MISSING', 'The file "setup/footer.php" was not found. Please install Wikka again!');
if (!defined('ERROR_HEADER_MISSING')) define('ERROR_HEADER_MISSING', 'A header template could not be found. Please make sure that a file called <code>header.php</code> exists in the templates directory.'); //TODO Make sure this message matches any filename/folder change
if (!defined('ERROR_FOOTER_MISSING')) define('ERROR_FOOTER_MISSING', 'A footer template could not be found. Please make sure that a file called <code>footer.php</code> exists in the templates directory.'); //TODO Make sure this message matches any filename/folder change
if (!defined('ERROR_NO_DB_ACCESS')) define('ERROR_NO_DB_ACCESS', 'The wiki is currently unavailable. <br /><br />Error: Unable to connect to the MySQL database.');
if (!defined('PAGE_GENERATION_TIME')) define('PAGE_GENERATION_TIME', 'Page was generated in %.4f seconds'); // %.4f - generation time in seconds with 4 digits after the dot
if (!defined('WIKI_UPGRADE_NOTICE')) define('WIKI_UPGRADE_NOTICE', 'This site is currently being upgraded. Please try again later.');
/**#@-*/

/**#@-*/
/**
 * Defines the current Wikka patch level. This should be 0 by default,
 * and does not need to be changed for major/minor releases.
 */
if(!defined('WIKKA_PATCH_LEVEL')) define('WIKKA_PATCH_LEVEL', '1');


/**#@+
 * Simple constant. May be made a configurable value.
 */
/**
 * Defines the default cookie name.
 */
if (!defined('BASIC_COOKIE_NAME')) define('BASIC_COOKIE_NAME', 'Wikkawiki');
/**
 * Length to use for generated part of id attribute.
 */
define('ID_LENGTH',10);			// @@@ maybe make length configurable
/**
 * Character used for multi-path lists
 */
if(!defined('PATH_DIVIDER')) define('PATH_DIVIDER', ',');
/**#@-*/


$wakkaDefaultConfig = array(
    'mysql_host'				=> 'localhost',
    'mysql_database'			        => '',
    'mysql_user'				=> '',
    'table_prefix'				=> '',

    'root_page'				        => 'HomePage',
    'wakka_name'				=> 'MyWikkaSite',
    'base_url'					=> $t_scheme.$t_domain.$t_port.$t_request.$t_query,
    'rewrite_mode'				=> $t_rewrite_mode,
    'wiki_suffix'				=> '@wikka',
    'enable_user_host_lookup'	=> '1',	#enable (1, default) or disable (0) lookup of user hostname from IP address

    'action_path'				=> 'plugins/actions'.PATH_DIVIDER.'actions',
    'handler_path'				=> 'plugins/handlers'.PATH_DIVIDER.'handlers',
    'gui_editor'				=> '1',
    'theme'						=> 'light',

    // formatter and code highlighting paths
    'wikka_formatter_path' 		=> 'plugins/formatters'.PATH_DIVIDER.'formatters',		# (location of Wikka formatter - REQUIRED)
    'wikka_highlighters_path'	=> 'formatters',		# (location of Wikka code highlighters - REQUIRED)
    'geshi_path' 				=> '3rdparty/plugins/geshi',				# (location of GeSHi package)
    'geshi_languages_path' 		=> '3rdparty/plugins/geshi/geshi',		# (location of GeSHi language highlighting files)

    // template
    'wikka_template_path' 		=> 'plugins/templates'.PATH_DIVIDER.'templates',		# (location of Wikka template files - REQUIRED)
    'safehtml_path'				=> '3rdparty/core/safehtml',
    'referrers_purge_time'		=> '30',
    'pages_purge_time'			=> '0',
    'xml_recent_changes'		=> '10',
    'hide_comments'				=> '0',
    'require_edit_note'			=> '0',		# edit note optional (0, default), edit note required (1) edit note disabled (2)
    'anony_delete_own_comments'	=> '1',
    'public_sysinfo'			=> '0',		# enable or disable public display of system information in SysInfo
    'double_doublequote_html'	=> 'safe',
    'external_link_tail' 		=> '<span class="exttail">&#8734;</span>',
    'sql_debugging'				=> '0',
    'admin_users' 				=> '',
    'admin_email' 				=> '',
    'upload_path' 				=> 'uploads',
    'mime_types' 				=> 'mime_types.txt',

    // code hilighting with GeSHi
    'geshi_header'				=> 'div',	# 'div' (default) or 'pre' to surround code block
    'geshi_line_numbers'		=> '1',		# disable line numbers (0), or enable normal (1) or fancy line numbers (2)
    'geshi_tab_width'			=> '4',		# set tab width
    'grabcode_button'			=> '1',		# allow code block downloading

    'wikiping_server' 			=> '',

    'default_write_acl'			=> '+',
    'default_read_acl'			=> '*',
    'default_comment_acl'		=> '*',
    'allow_user_registration'	=> '1',
    'enable_version_check'      => '1',
    'version_check_interval'	=> '1h'
);
